#include<iostream>
#include<fstream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
using namespace std;
int a[200010],tn,n;
int b[200010];
int main(){
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		b[i]=1;
	}tn=n;
	b[0]=100000;
	while(tn){
		int top=100;
		for(int i=1;i<=n;i++){
			if(b[i]!=0){
				if(top!=a[i]){
					printf("%d ",i);
					b[i]=0;tn--;
				}
				top=a[i];
			}
		}
		printf("\n");
	}
	return 0;
}
